Director Article

3D User Interfaces and 3D App Building Using the Chrome Library Set of Behaviors


Table of Contents

  1. Introduction
  2. Setting Up the Texture Render Format
  3. Setting Up Hardware Anti-Aliasing (FSAA)
  4. Setting Up the Shader Blend Level for Reflection
  5. Opening and Closing the Movable Parts of the Car
  6. Creating a UI on Top of the 3D Scene
  7. Changing the Camera
  8. Creating a 3D Navigation System for a Website
  9. Controlling Flash from Shockwave 3D
  10. Afterword and Conclusion

Opening and Closing the Movable Parts of the Car

You want the user to be able to open and close the movable parts of the car, namely the hood, the trunk, the doors, and the seats. This is simple as you only have to care about the rotation on one axis. The pivot point of each separate model of the car has already been set in 3DS Max, so all movable parts rotate correctly about their axes.

Movable Parts of the Car
Hood Target Y axis rotation : 50.00
Trunk Target Y axis rotation : -65.00
Front seat left Target Y axis rotation : 20.00
Front seat right Target Y axis rotation : 20.00
Front door left Target Z axis rotation : -75.00
Front door right Target Z axis rotation : 75.00
Rear door left Target Z axis rotation : -75.00
Rear door right Target Z axis rotation : 75.00

  1. Drag and drop the Open/Close Model behavior from the Chrome Lib onto the W3D sprite, either on the Stage or in the Score.

    The Open/Close Model behavior

    Figure 9. The Open/Close Model behavior

    The following dialog box appears:

    The Open/Close Model parameters dialog box

    Figure 10. The Open/Close Model parameters dialog box

  2. Select the model you want to manipulate.
  3. Make sure the Copy Position parameter is checked and enter the correct rotation on the relevant axis, for example, 20 degrees on the Y axis for the Front Seat Right model.

    If the sliders are too touchy for you, enter precise values in the behavior tab of the Property inspector:

The Property inspector showing the Open/Close model behavior

Figure 11. The Property inspector showing the Open/Close model behavior

You must create an instance of the behavior for each model you want to open/close. In this case, you would have to drag and drop the same behavior eight times, each time with a different set of parameters (that is, a different model, axis, and rotation value).

Click the Play button in the Control panel or press Enter to start the movie. Click the hood, the trunk, the doors, or the seats, and they open in a smooth, progressive way. Click them again, and they will close in the same way. You can interrupt the opening or closing of a movable part while it rotates by clicking it, and it will immediately start rotating in the opposite direction. The rotation boundaries on the axis are defined by the original rotation and by the set target rotation behavior.

The car with the open hood and open driver door

Figure 12. The car with the hood and the driver door open